#!/usr/bin/env bash

# set -eo pipefail

## Evaluate Staged Files, Format lines changed, include in commit
git diff --diff-filter=d --staged --name-only | grep -e '\.swift$' | while read line; do
  swiftformat "${line}";
  git add "$line";
done
